﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Concert.Tools;

namespace Concert
{
    public partial class FrmStart : Form
    {
        
        
        #region champs
        
        bool isConnected = NetManager.isConnected();
        
        #endregion

        #region Methodes

        private void VerifConnect(Form formulaire)
        {
            if (!isConnected)
            {
                MessageBox.Show("Attention, la connexion Internet est inactive !\n\nElle est indispensable pour la recherche des concert sur cette aplication ...", "ZiK'nCo : avertissement", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                //Application.Exit();
            }
            else
            {
                formulaire.Show();
            }
        }

        #endregion

        public FrmStart()
        {
            InitializeComponent();
        }

        private void FrmStart_Load(object sender, EventArgs e)
        {

                String jour = DateTime.Now.ToString("dd/MM/yyyy");
                String heur = DateTime.Now.ToString("HH:mm:ss");
                notifyIconEtat.ShowBalloonTip(5000, "BIENVENUE", "Vous venez de lancer l'apli à " + heur + " le " + jour + " Bonne Journée !", ToolTipIcon.Info);
        
        }

        private void quitterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void aProposToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //Ouverture du menu à propos
            FrmAPropos aPropos = new FrmAPropos();
            aPropos.Show();
        }

        private void concertsDunArtisteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            VerifConnect(new FrmRechByArtist());
        }

        private void concertsPourUneSalleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            VerifConnect(new FrmRechEventsByVenue());
        }

        private void evenementsParLieuToolStripMenuItem_Click(object sender, EventArgs e)
        {
            VerifConnect(new FrmRechByGeo());
        }

    }
}
